Method and apparatus for realizing adaptive quantization in process of image coding

ABSTRACT

A method for realizing adaptive quantization in image encoding and dequantization in image decoding is disclosed. In the adaptive quantization method, an image to be encoded is divided into one or more blocks, and each block is transformed to obtain one or more transform coefficients, the method comprising: acquiring parameter information of neighbor blocks of a current block; determining a quantization mode for the current block according to the parameter information of the neighbor blocks; and quantizing transform coefficients of the current block in the determined quantization mode. The quantization mode includes at least one of quantization matrix, quantization parameter and quantization step.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No.13/418,063, filed Mar. 12, 2012, which is a continuation of U.S. patentapplication Ser. No. 12/210,939, filed Sep. 15, 2008, now U.S. Pat. No.8,160,374, which is a continuation of International Patent ApplicationNo. PCT/CN2007/000863, filed Mar. 16, 2007. The InternationalApplication claims priority to Chinese Patent Application No.200610064858.X, filed Mar. 16, 2006. All of the above-listed patents andapplications are hereby incorporated by reference in their entireties.

FIELD OF THE INVENTION

The present invention relates to the field of image/video codingtechnology, and more particularly, to a technology for decidingquantization modes in the process of image/video coding.

BACKGROUND

In image encoding and decoding technology, with respect to the processof image encoding, an image is generally partitioned into coding blocksand then subject to the encoding process. The partitioned image blocksis then transformed by an orthogonal transform to obtain correspondingblock transform coefficients, and the block transform coefficients arethen quantized and clipped to integers and are then subject to entropycoding to finally obtain a encoded bit stream corresponding to theimage, thereby realizing the encoding process of the image.

In the architecture of video compression/coding, data feed toquantization computation during intra coding is the values of imageblock transform coefficients, while data feed to quantizationcomputation during inter-coding is values of residual coefficients.Since content information of an image is completely stored in thetransform coefficients or residual coefficients, quality control ofcompressed image may be realized by controlling quantization process inimage coding process.

Images described in the present invention include static images, movingimages, residual image of two adjacent images of moving images, targetimage obtained by performing an operation on any number of movingimages, etc.

In encoding, quantization of transform coefficients is generallyrealized by a quantization matrix, e.g. by the following equation:

$\begin{matrix}{{Q\left( {i,j} \right)} = \left\lbrack \frac{{Coe}\left( {i,j} \right)}{{QM}\left( {i,j} \right)} \right\rbrack} & (1)\end{matrix}$

where, Coe(i, j) is a value of a pixel at location (i, j) aftertransform computation on image blocks, which is referred to as transformcoefficient, QM(i, j) is a quantization matrix, Q(i, j) is a value oftransform coefficient after quantization and truncation, which isreferred as quantized coefficient value, and [•] is the truncationcalculation.

Since the details of images of different contents represent differentimage frequencies and human eyes have different subjective feeling fordifferent parts of an image, different quantization methods that matchfeatures of human eyes should be used for images of different contents.

At present, in image/video coding standards such as Joint PhotographicExperts Group (JPEG), MPEG-1 (MPEG, Motion Picture Experts Group),MPEG-2 and MPEG-4, fixed quantization matrixes are used for quantizationcomputation in image coding, wherein in JPEG image coding standard, thequantization matrix is stored in the image header, while in MPEG-1,MPEG-2 and MPEG-4, the quantization matrixes are stored in the sequenceheader. Therefore, for a sequence of images, the MPEG standard allowsonly one quantization matrix in sequence bit stream, that is, the wholesequence uses a same fixed quantization matrix in image quantization.

While an image is observed from human eyes, the quality evaluation ofthis image is made according to the subjective quality of the imageperceived by human eyes, a better subjective image quality is obtainedwhile a suitable quantization method is used for image quantization tomatch vision features of human eyes, i.e. for an image sequence, bettersubjective image quality is obtained only if appropriate quantizationmatrixes are selected in quantization.

However, the contents of images in a sequence are rarely identical,instead, they may vary greatly, that is, details of images in a samesequence are different from each other, and if a same quantizationmatrix is used in quantization for the entire sequence, the compressedimages cannot achieve optimal subjective quality.

SUMMARY

Embodiments of the present invention provide a method and apparatus forimplementing adaptive quantization in the process of image coding, whichcan improve the subjective quality of compressed images at the same bitrate.

Embodiments of the present invention provide a method for implementingadaptive quantization in the process of image coding, including:

acquiring parameter information on neighbor blocks of a current block;

determining a quantization mode for the current block according to theparameter information on the neighbor blocks; and

performing quantization processing on transform coefficients of thecurrent block with the determined quantization mode.

Embodiments of the present invention provide an apparatus forimplementing adaptive quantization in the process of image coding,including:

a neighbor block parameter information acquiring unit, adapted toacquire parameter information on neighbor blocks of a current block;

a quantization mode decision unit, adapted to determine the quantizationmode for the current block according to parameter information onneighbor blocks acquired by the neighbor block parameter informationextractor; and

a quantization processing unit, adapted to perform the quantizationprocessing on transform coefficients of the current block with thequantization mode determined by the quantization mode decision unit.

As can be seen from the technical solution provided in embodiments ofthe present invention, embodiments of the present invention areimplemented according to vision features of human eyes, that is,quantization processing is carried out by selecting appropriatequantization matrixes in the process of image coding. Therefore, inimage coding, quantization processing on image sequence may be welladapted to content features of the image, thereby greatly improving thesubjective quality of compressed images at the same bit rate.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram showing the layout of the current blockand neighbor blocks; and

FIG. 2 is a schematic diagram showing the structure of an apparatusaccording to an embodiment of the present invention.

DETAILED DESCRIPTION

Quantization modes used in embodiments of the present invention include,but are not limited to, quantization matrix, quantization parameter andquantization step. The encoding and decoding of images may be performedwith a determined quantization mode.

In particular, in embodiments of the present invention, correspondingquantization mode is determined according to image information, as aresult, a certain extent optimal quantization mode can be obtained foreach area of the image, wherein the image information includes, but isnot limited to, information of image content and information generatedfrom the image coding procedure. Therefore, the subjective quality atthe same bit rate of the compressed image can be greatly improved byperforming quantization calculation for image regions with thequantization mode determined in embodiments of the present invention.

The method of adaptive quantization provided in the present invention,as called as the quantization mode decision method can be embodied inthe following specific implementations.

Implementation Mode 1

It may be decided whether the quantization mode used for the currentblock is different from that of neighbor blocks according to the blockmode information on neighbor blocks of a current block, and the qualityof the specifically used quantization mode is determined when it isdetermined to use a different quantization mode, so as to determine thequantization mode to be selected for the current block. The size of theblock herein may be M×N, M, N=2, 4, 8, 16 or other sizes. The block modeinformation includes, but is not limited to, at least one of block size,block type, direction features of the block and block mode distributionof neighbor blocks.

Specifically, in this implementation, it may be decided, in anintra-frame or inter-frame manner, whether a different quantization modeis used for the current block according to different frame types and theblock mode information of neighbor blocks of the current block. Theframe types include, but are not limited to, any frame type thatcontains block mode information, such as I frame, P frame, and B frame.

Implementation Mode 2

It is decided whether a different quantization mode is used for currentblock according to the motion vector information on neighbor blocks ofthe current block, and the quality of the specifically used quantizationmode is determined when it is determined to use a different quantizationmode, so as to determine the quantization mode to be selected for thecurrent block. The motion vector information includes, but is notlimited to, motion vector magnitude, motion vector direction, and motionvector distribution of neighbor blocks.

Specifically, in the implementation 2, it may also be decided whether adifferent quantization mode is used for the current block according todifferent frame types and motion vector information on neighbor blocksof the current block. The frame types include, but are not limited to,any frame types that contain motion vector information, such as P frameand B frame.

Implementation Mode 3

The quantization mode quality used for the current block is decidedaccording to information combining not only on neighbor blocks but alsoon the current block itself, and the corresponding quantization mode isfurther determined.

Embodiments of the present invention provide a solution for realizingquantization adapted to image content, in which different quantizationmodes are used for different content parts of an image sequence togreatly improve the subjective quality of compressed image at the samebit rate.

In particular, in embodiments of the present invention, the quantizationmode for the current block is decided with neighbor blocks parameterinformation in the image coding procedure. The parameter information ofneighbor blocks includes, but is not limited to, at least one of theblock mode information of neighbor blocks, prediction information ofneighbor blocks and motion vector information of neighbor blocks. Theabove information of neighbor blocks may all predict the image contentfeatures of the current block, and thus at least one of them may be usedfor determining the quantization mode of the current block.

With consideration of vision feature of human eyes, corresponding rulesthat should be followed during the decision of quantization modes forthe current block include, but are not limited to, the following.

(1) For regions belonging to details of an image should be maintained aspossible as enough, and the corresponding quantization mode to be usedshould maintain more high frequency information, that is, high qualityquantization modes should be used.

(2) For regions belonging to edges of a moving part of an image, morehigh frequency information should be maintained, and high qualityquantization modes also need to be used.

(3) For regions with rapid motion of an image, a certain decrease ofobjective quality would not impose great influence on subjectivequality, and thus slightly rough quantization modes, i.e., low qualityquantization modes may be used.

In the above three cases, different quality quantization modes may beused for characteristics of different parts of an image, wherein thehigh quality quantization modes and low quality quantization modes maybe predefined, and meanwhile, more levels of different qualityquantization modes may be set, for example, high, middle and low qualityquantization matrixes may be set as quantization modes available forvarious current blocks. Specifically, quantization modes of multiplelevel quantization qualities may be first set in the system, andcorresponding selection conditions for selecting a quantization mode ofeach level of quantization quality are set based on the parameterinformation of neighbor blocks or parameter information of current blockand neighbor blocks, then the quantization mode to be used for thecurrent block may be determined according to the parameter informationof neighbor blocks or the parameter information of current block andneighbor blocks. 100291 For example, for quantization matrixes ofdifferent qualities, quantization modes may be classified into thefollowing type.

-   (1) Quantization Mode 0:

Default quantization mode, that is, the quantization matrix used for thecurrent coding macroblock is same as the current default quantizationmode.

-   (2) Quantization Mode 1:-   Details-preserving mode, that is, the quantization matrix used for    the current coding macroblock should be that the quantized image    preserves image details as more as enough, and this quantization    mode is a high quality quantization mode.-   (3) Quantization Mode 2:

Undetailed quantization mode, that is, the current coding macroblock isnot the details of an image and image details of the quantized imageneeds not to be preserved. This quantization mode is a low qualityquantization mode.

Then, conditions for selecting different quantization modes are setbased on block parameter information, and hence the quantization mode tobe used for the current block may be selected at the encoder side andthe decoder side, respectively, according to parameter informationconditions.

In other words, in practical procedure of image/video coding, based onpreset rules, the quantization mode for current block is decided withparameter information on neighbor blocks, that is, quantization modes ofdifferent qualities corresponding to parameter information on neighborblocks are preset as the rules of decision. The rules to be set include:the conditions that are determined to use predetermined high qualityquantization mode for the current block when the parameter informationon neighbor blocks meet these conditions, as well as the condition thatare determined to use predetermined low quality quantization mode forthe current block when the parameter information on neighbor blocks meetthese conditions, wherein the high quality quantization modes refer toquantization modes that preserve more frequency information and havehigh image fidelity, and the low quality quantization modes refer toquantization modes that lose some frequency information and have lowimage fidelity.

In addition, for different frame types, i.e. for intra-coding frames andinter-coding frames, different quantization modes decision rules need tobe used. For example, in an intra-coding picture, mode information ofthe detailed part of image is generally more plenty than that of theundetailed part of an image, and thus, if block mode information ofneighbor macroblocks (i.e. neighbor blocks) is different from eachother, a higher quality quantization mode should be used for the currentblock. In inter-coding picture, the prediction mode of detailed parts ofan image is generally much plenty than that of undetailed part of image,and block size information on neighbor blocks and mode information onneighbor blocks may be used in decision condition of quantization modesdecision.

To facilitate understanding of embodiments of the present invention,specific processing of a quantization mode decision according toembodiments of the present invention will be described below, whichmainly includes the following cases:

Different decision rules are used for different frame types.

For different frame types, namely intra-coding frames and inter-codingframes, the decision rules may be different. The above-mentionedneighbor macroblock is defined in FIG. 1. In case of an intra-codingpicture, intra-prediction mode and block type of neighbor blocks may beused in the decision conditions. In case of inter-coding picture,inter-prediction mode (including block size and block type) and motionvector of neighbor blocks may be used in the decision conditions.

In FIG. 1, the current block is E, neighbor blocks of E are A, B, C andD. Further, block sizes of A, B, C, D, and E may be identical or may bedifferent, wherein the neighbor blocks in vertical direction of thecurrent block E are A and D, and neighbor blocks in horizontal directionof the current block E are B and D or C and D. The neighbor blocks maybe direct neighbor blocks of E or indirect neighbor blocks. The directneighbor blocks of E are adjacent border blocks of E, and the indirectneighbor blocks are neighbor blocks of adjacent border blocks of E.

Decision for different frame types will be described below.

I. Quantization Modes Decision for Intra Coding Picture.

In this case, the current frame is an intra-coding picture such as an Iframe, and corresponding quantization modes of the current block aredetermined with an intra-quantization mode decision. The intra-codingblock refers to a block with intra-prediction mode.

Specifically, for an intra-coding picture, the prediction mode of imagedetail parts is more plenty than that of others and mode information onneighbor blocks is typically different. Thus, if prediction modes ofneighbor blocks are different, it means that the current macroblock maybe a detail region or region edges of the image, and then a high qualityquantization mode that can preserve details should be used for thecurrent macroblock. For example, in FIG. 1, a low-quality quantizationmode that does not preserve details is selected for the currentmacroblock only when prediction mode information on neighbor blocksmeets one of the following conditions.

(1) Neighbor blocks in vertical direction edge of E use identicalquantization modes, e.g. blocks A and D use identical quantizationmodes;

(2) Neighbor blocks in horizontal direction edge of E use identicalquantization modes, e.g. blocks B (or C) and D use identicalquantization modes.

The identical prediction mode means that prediction modes of two blocksare the same. For example, two blocks are both of vertical predictionmode or horizontal prediction mode.

II. Quantization Modes Decision for Inter-Coding Picture.

In this case, the current frame is an inter-coding picture such as Pframe, B frame, and then corresponding quantization modes of the currentblock are determined with an inter-quantization mode decision.

Specifically, for an inter-coding picture, the block mode information ofimage detailed parts is more plenty than that of others. Thus, ifinter-coding modes of neighbor macroblocks are different, it means thatthe current macro block may be a detail region or region edge of theimage, and then a high quality quantization mode that can preservedetails should be used for the current macroblock. For example, in FIG.1, a low quality quantization mode that does not preserve details may beselected for the current macro block only when prediction modeinformation on neighbor macroblocks meets one of the followingconditions:

(1) No one in neighbor blocks A, B, C and D is of an intra-coding block;

(2) No one in neighbor blocks A, B, C and D is of a small size codingblock;

(3) Neighbor blocks in vertical directions, such as A and D, are bothlarge size coding blocks; and

(4) Neighbor blocks in horizontal directions, such as B (or C) and D,are both large size coding blocks.

In addition, according to vision feature of human eyes, human eyes arenot sensitive for image regions with fast motion, and thus low qualityquantization modes may be used for these regions.

Further, in the neighbor blocks, each macroblock contains motion vectorsitself and each motion vector contains motion vector magnitude andmotion vector direction. Therefore, motion vectors of each neighbormacroblock and motion vector distribution of neighbor macroblocks may beused to estimate motion characteristics of the current coding area, andhence may be used in decision conditions for inter-coding quantizationmodes.

The mode information of coding blocks include, but are not limited to,information such as block size and prediction mode of the coding block.The so-called block size refers to the size of a block used forintra-frame prediction and compensation of intra-coding block or formotion compensation of inter-coding blocks, and in state-to-art videocoding standards, inter-coding allows motion compensation with multiplesize of blocks. The so-called small size mode coding block refers to ablock used with small coding size, such as a 4×4 block, and theso-called large size mode coding block refers to a block used with largesize such as a 16×16 block and SKIP block.

Quantization modes for the current block may be obtained through theabove process and quantization procedure on coefficient data may befurther performed.

The process of a quantization mode decision according to the inventionwill now be described by taking H.264/AVC standard as an example.

Different decision rules are used for different frame types.

The frame types include I frames, P frames and B frames in H.264/AVC.The above-mentioned definition of neighbor macroblocks is still as shownin FIG. 1. In an I frame, intra-prediction modes of neighbor blocks maybe used in the decision conditions. In a P frame, information such asinter-prediction mode and motion vector may be used in the decisionconditions for determine the quantization mode. In H.264/AVC, for a 4×4block, the prediction mode of neighbor intra-blocks has up to 9prediction directions. In H.264/AVC, the prediction mode of inter-codingframe supports motion compensation technology with multiple block sizesin which inter-frame prediction mode indicate the block sizeinformation, such as 16×16, 16×18, 8×8, etc.

In H.264/AVC, inter picture may have blocks with intra prediction mode.The small block size mode may refer to modes of block size 8×8 or belowin H.264/AVC. The large block size mode may refer to modes of block size8×8 or above in H.264/AVC.

Embodiments of the present invention will be described below, assumingthat neighbor blocks of E are edge blocks directly adjacent to E.

I. If the Current Frame is I Frame, Intra Quantization Mode Decision isUsed.

For an intra-coding image, prediction modes of image details are usuallymore complex than those of undetailed parts of image, and modeinformation on neighbor blocks is generally different. Therefore, ifprediction modes of neighbor macroblocks are different, high qualityquantization modes should be used. In FIG. 1, low quality quantizationmodes can be selected only if prediction mode information on neighbormacroblocks meets one of the following conditions:

(1) neighbor blocks in vertical edge of E have identical predictionmode, e.g. block A and D have identical modes, in which the predictionmodes are identical means for example they are both of the horizontaldirection prediction mode;

(2) neighbor blocks in horizontal edge of E have identical predictionmode, e.g. blocks B (or C) and D have identical modes, in which theprediction modes are identical means for example they are both of thehorizontal direction prediction mode.

For FIG. 1, with reference to the above-described quantization modes 0,1 and 2, quantization modes used for the current block E may bedetermined in the following decision conditions:

(1) If one of A, B, C and D is of non-directional prediction mode oraverage (DC) prediction mode, quantization mode 0, namely the defaultquantization mode, is used for E;

(2) If neighbor blocks in a vertical edge of E have the identicalprediction mode, e.g. block A and D have the identical prediction mode,e.g. horizontal direction prediction mode, or neighbor blocks inhorizontal edge of E have identical prediction mode, e.g. block B and Dor block B and C have identical modes, quantization mode 0, namely thedefault quantization mode, is used for E; and

(3) If A, B, C and D do not satisfy the above conditions (1) and (2),the quantization mode 1, namely the quantization mode that preservesdetails, is used for E.

II. If the Current Frame is a P Frame, Inter Quantization Mode Decisionis Used.

In FIG. 1, low quality quantization modes can be selected only if modeinformation on neighbor macro blocks satisfies one of the followingconditions:

(1) No one of neighbor blocks A, B, C and D are of intra-coding blocks;

(2) No one of neighbor blocks A, B, C and D are of blocks with smallsize prediction modes;

(3) Neighbor blocks in vertical edge of E have identical modes, e.g. Aand D have identical modes, both of which are of blocks with large sizeprediction modes; and

(4) Neighbor blocks in horizontal edge of E have identical modes, e.g. B(or C) and D have identical modes, both of which are of blocks withlarge size prediction modes.

Still referring to the above-mentioned three quantization modes 0, 1 and2, in P frames, quantization mode 0 is defaulted to be used for thecurrent block E, and quantization decision conditions for the currentblock E include:

(1) if one of A, B, C and D is an intra-coding block, quantization mode1, namely the details preserved mode, is used for E;

(2) if one of A, B, C and D is a small size block, such as a 4×4 blockor a 8×8 block, quantization mode 1, namely the details preserved mode,is used for E;

(3) if neighbor blocks in vertical edge and/or neighbor blocks inhorizontal edges are of skip mode, for example, blocks A and D invertical neighbor edges are of skip mode and/or blocks B (or C) and D inhorizontal neighbor edge are of skip mode, which indicates that theprediction mode of the current block E may also be skip mode andindicates that the current block E just corresponds to a coding block inthe previous frame but it cannot be determined whether the current blockE belongs to details of the image, and thus quantization mode 0, namelythe default quantization mode, is used for E; and quantization mode 1,namely the details preserved mode, is also used for E;

(4) if neighbor blocks in a vertical edge or neighbor blocks in ahorizontal edge are of blocks with large block size prediction modes,for example, A and D are of block size 16×16 prediction modes or B and Dare of block size 16×16 prediction modes or B and C are of block size16×16 prediction modes, which indicates that the current block E islikely to be a undetailed region, and thus quantization mode 2, namelythe quantization mode that does not preserve details, is used for E; and

(5) if A, B, C and D do not satisfy the above conditions (1)-(4), thequantization mode 1, namely the quantization mode that preservesdetails, is used for E.

Similarly, if the current frame is a B frame, inter-quantization modedecision is also used for the current block E, and specific decisionconditions are as follows:

(1) if neighbor blocks in the vertical edge and/or neighbor blocks inthe horizontal edge are of skip modes, for example, blocks A and D inthe vertical neighbor edge are of skip modes and/or blocks B (or C) andD in the horizontal neighbor edge are of skip modes, quantization mode0, namely the default quantization mode, is used for E;

(2) if neighbor blocks in vertically edge and/or neighbor blocks inhorizontal edge are of block size 16×16 prediction modes, for example,blocks A and D in the vertical neighbor edge are of 16×16 modes and/orblocks B (or C) and D in with the horizontally neighbor edge are ofblock size 16×16 prediction modes, quantization mode 2, namely thequantization mode that does not preserve details, is used for E; and

(3) if A, B, C and D do not satisfy the above conditions (1) and (2),the quantization mode 1, namely the quantization mode that preservesdetails, is used for E.

Embodiments of the present invention also provide an apparatus forrealizing adaptive quantization in the procedure of image/video coding,which decides quantization modes for the current block according tocoding parameter information on neighbor blocks. As shown in FIG. 2, thespecific implementation structure of the apparatus includes:

a neighbor block parameter information acquiring unit, adapted toacquire parameter information on neighbor blocks of the current block,wherein the neighbor block parameter information acquiring unit isembodied as a neighbor macroblock coding information extractor;

a quantization mode decision unit, adapted to determine the quantizationmode for the current block according to parameter information onneighbor blocks acquired by the neighbor block parameter informationextractor; wherein the quantization mode decision unit specificallyincludes an intra-coding quantization mode decision subunit, aninter-coding quantization mode decision subunit, and a blockquantization mode determining unit adapted to determine quantizationmode of the current coding block; and

a quantization processing unit, adapted to perform quantizationcomputation on transform coefficients of the current block with thequantization mode determined by the quantization mode decision unit,wherein the quantization processing unit may specifically be a quantizerin encoder or a dequantizer in decoder.

The apparatus may also comprise a frame type classifier for acquiringthe type of the current coding frame and notifying the type to thequantization mode decision unit.

Individual description of the parts specifically contained in thequantization mode decision apparatus will be given below.

The frame type classifier is adapted to acquire the type of frame whichthe current coding block belongs, such as I frame, P frame or B frame,and notify frame type information to the intra-coding quantization modedecision subunit and the inter-coding quantization mode decisionsubunit. Different frame types would have different influence on thechoice of the decision subunit and the result of quantization modedecision.

The neighbor block coding information extractor is adapted to acquireparameter information on neighbor blocks of the current coding block, inwhich acquiring parameter information includes at least one of the blockpartition information of neighbor blocks, prediction information ofneighbor blocks, motion vector information of neighbor blocks andinformation of the quantization mode used for neighbor blocks, andnotify this parameter information to the intra-coding quantization modedecision subunit and the inter-coding quantization mode decision subunitin order to select different sub-decision unit in the quantization modedecision unit according to different coding parameter information ofneighbor blocks.

The intra-coding quantization mode decision subunit is adapted to decidethe quantization mode for the current coding block according to theframe type and the acquired intra-coding information of neighbor blocks,wherein the acquired intra-coding information may include block size,block prediction mode, direction of intra-block prediction, andquantization mode information, etc. Typically, the intra-quantizationmode decision subunit may be divided into a neighbor block size basedsub-decision unit, a neighbor block type based sub-decision unit and/ora neighbor block intra-prediction mode (or direction) based sub-decisionunit according to the input intra-coding information of neighbor blocks.

The inter-coding quantization mode decision subunit is adapted to decidethe quantization mode for the current coding block according to theframe type and the acquired inter-coding information of neighbor blocks,wherein the acquired inter-coding information may include block size,block mode, inter-prediction direction information of block, directionof block motion vector, magnitude of block motion vector, quantizationmode information of neighbor blocks, etc. Typically, theinter-quantization mode decision subunit may be divided into a neighborblock size based sub-decision unit, a neighbor block type basedsub-decision unit, a neighbor block inter-prediction mode (or direction)based sub-decision unit and/or a neighbor block motion vector basedsub-decision unit according to the input inter-coding information ofneighbor blocks.

The block quantization mode determining unit is to finally select anddetermine a quantization mode for the current coding block as one ofseveral quantization modes, according to the output from theintra-coding quantization mode decision subunit or the inter-codingquantization mode decision subunit, input the determined quantizationmode to the quantization processor so as to update parameter values ofthe quantization processor, and thus control the quantization quality ofquantization processor. The quantization modes may be of various types,and typical modes may include a quantization mode that preserves imagedetails, a quantization mode that does not preserve image details, and aquantization mode which is the same as the default quantization mode.

The operation principle of the quantization mode decision device is toselect a proper quantization mode decision subunit according to frametype and coding parameter information of neighbor blocks, and

(1) In case of an intra-coding image, the intra-quantization modedecision subunit is selected, and according to intra-coding informationof neighbor blocks, one sub-decision unit is further selected among theneighbor block size based sub-decision unit, the neighbor block typebased sub-decision unit and the neighbor block intra-prediction mode (ordirection) based sub-decision unit, and then the mode decision result isoutput, wherein

the neighbor block size based sub-decision unit is adapted to decidequantization mode according to neighbor block size information;

the neighbor block type based sub-decision unit is adapted to decidequantization mode according to neighbor block type information; and

the neighbor block intra prediction mode based sub-decision unit isadapted to decide quantization mode according to neighbor blockintra-prediction mode information.

(2) In case of an inter-coding image, either the intra-quantization modedecision subunit or the inter-quantization mode decision subunit isselected for current block according to the block type of the currentcoding block.

(21) If intra coding is used for the current block, the intraquantization mode decision subunit is used and the structure thereof maybe same as (1). However, the input coding information of neighbor blocksto be used may be different from (1). When the intra-quantization modedecision subunit is used for inter-coding images, the coding parameterinformation on neighbor blocks may include more types, for example,sizes of neighbor blocks may include 8×8, 16×8, 8×16, and 16×16.

(22) If inter-coding is used for the current block, theinter-quantization mode decision subunit is used. Specifically, onesub-decision unit is selected among a neighbor block size basedsub-decision unit, a neighbor block type based sub-decision unit, aneighbor block intra-prediction mode (or direction) based sub-decisionunit, a neighbor block motion vector based sub-decision unit accordingto inter-coding information of neighbor blocks, and then thequantization mode decision result is output; wherein

the neighbor block size based sub-decision unit is adapted to decidequantization mode according to neighbor block size information;

the neighbor block type based sub-decision unit is adapted to decidequantization mode according to neighbor block type information;

the neighbor block inter prediction mode based sub-decision unit isadapted to decide quantization mode according to neighbor block interprediction mode information; and

the neighbor block motion vector based sub-decision unit is adapted todecide quantization mode according to motion vector information onneighbor blocks.

In summary, the quantization mode decision solution provided inembodiments of the present invention has the following advantages.

With this quantization mode decision method, adaptive quantization basedon macroblock size may be achieved in image coding, that is, eachmacroblock may have individual quantization mode.

Further, for image coding at block level, while achieving block leveladaptive quantization, no quantization matrix needs to be transferred inthe image level and macroblock level bit stream, which results in thatno additional bit stream overhead exists for the block level.

In addition, embodiments of the present invention are implementedaccording to vision features of human eyes. Thus, during codingprocedure, quantization computation of image sequence can be welladapted to image content, and thus subjective quality of the compressedimage may be greatly improved at the same bit rate.

The above description is only preferred embodiments of the presentinvention, and the scope of the present invention is not limitedthereto. Any variations or replacements easily occur to those skilled inthe art in the technical scope disclosed by the present invention, andthese variations or replacements should be covered by the scope of thepresent invention. Therefore, the protection scope of the presentinvention should be defined by the claims.

What is claimed is:
 1. A method for realizing adaptive quantization inimage encoding, wherein an image to be encoded is divided into one ormore blocks, and a current block of the one or more blocks istransformed to obtain one or more transform coefficients, the methodcomprising: acquiring parameter information of neighbor blocks of thecurrent block; determining a quantization mode for the current blockaccording to the parameter information of the neighbor blocks; andquantizing transform coefficients of the current block with thedetermined quantization mode; wherein the quantization mode includes atleast one of quantization matrix, quantization parameter andquantization step.
 2. The method of claim 1, wherein the parameterinformation comprises at least one of the following: frame typeinformation; block mode information on the neighbor blocks; predictioninformation on the neighbor blocks; motion vector information on theneighbor blocks; and information on quantization modes used by theneighbor blocks.
 3. The method of claim 1, wherein the step ofdetermining the quantization mode for the current block comprises:determining the quantization mode for the current block in anintra-frame manner or an inter-frame manner, according to the parameterinformation of the neighbor blocks.
 4. The method of claim 1, whereinthe neighbor blocks of the current block comprise at least one of thefollowing: neighbor blocks on a left side of the current block in theimage; and neighbor blocks above the current block in the image.
 5. Themethod of claim 2, wherein the block mode information comprises at leastone of the following: a block size determined according to blockpartition information of the block mode information; a block typedetermined according to the block mode information; a block directiondetermined according to block direction information on the block modeinformation; and a block mode distribution information on the neighborblocks determined according to a spatial distribution relationship ofthe block mode information on the neighbor blocks.
 6. A method forrealizing adaptive quantization in image encoding, wherein an image tobe encoded is divided into one or more blocks, and a current block ofthe one or more blocks is transformed to obtain one or more transformcoefficients, the method comprising: acquiring parameter information ofneighbor blocks of the current block; determining a quantization modefor the current block according to the parameter information of theneighbor blocks; and quantizing transform coefficients of the currentblock with the determined quantization mode; wherein the neighbor blocksof the current block comprise at least one of the following: neighborblocks on a left side of the current block in the image; and neighborblocks above the current block in the image.
 7. The method of claim 6,wherein the determined quantization mode for the current blockcorresponds to a level of quantization quality of the current block. 8.The method of claim 6, wherein the step of determining the quantizationmode for the current block comprises: determining the quantization modefor the current block in an intra-frame manner or an inter-frame manner,according to the parameter information of the neighbor blocks.
 9. Themethod of claim 6, wherein the parameter information comprises at leastone of the following: frame type information; block mode information onthe neighbor blocks; prediction information on the neighbor blocks;motion vector information on the neighbor blocks; and information onquantization modes used by the neighbor blocks.
 10. The method of claim9, wherein the block mode information comprises at least one of thefollowing: a block size determined according to block partitioninformation of the block mode information; a block type determinedaccording to the block mode information; a block direction determinedaccording to block direction information on the block mode information;and a block mode distribution information on the neighbor blocksdetermined according to a spatial distribution relationship of the blockmode information on the neighbor blocks.
 11. A method for realizingadaptive dequantization in image decoding, wherein an image is dividedinto one or more blocks, and quantized transform coefficients of acurrent block of the one or more blocks are obtained from a bitstream,the method comprising: acquiring parameter information of neighborblocks of the current block; determining a quantization mode for thecurrent block according to the parameter information of the neighborblocks; and dequantizing quantized transform coefficients of the currentblock with the determined quantization mode; wherein the quantizationmode includes at least one of a quantization matrix, a quantizationparameter, and a quantization step.
 12. The method of claim 11, whereinthe parameter information comprises at least one of the following: frametype information; block mode information on the neighbor blocks;prediction information on the neighbor blocks; motion vector informationon the neighbor blocks; and information on quantization modes used bythe neighbor blocks.
 13. The method of claim 11, wherein the step ofdetermining the quantization mode for the current block comprises:determining the quantization mode for the current block in anintra-frame manner or an inter-frame manner, according to the parameterinformation of the neighbor blocks.
 14. The method of claim 11, whereinthe neighbor blocks of the current block comprise at least one of thefollowing: neighbor blocks on a left side of the current block in theimage; and neighbor blocks above the current block in the image.
 15. Themethod of claim 12, wherein the block mode information comprises atleast one of the following: a block size determined according to blockpartition information of block mode information; a block type determinedaccording to the block mode information; a block direction determinedaccording to block direction information on the block mode information;and a block mode distribution information on the neighbor blocksdetermined according to a spatial distribution relationship of the blockmode information on the neighbor blocks.
 16. A method for realizingadaptive dequantization in image decoding, wherein an image is dividedinto one or more blocks, and quantized transform coefficients of acurrent block of the one or more blocks are obtained from a bitstream,the method comprising: acquiring parameter information of neighborblocks of the current block; determining a quantization mode for thecurrent block according to the parameter information of the neighborblocks; and dequantizing transform coefficients of the current blockwith the determined quantization mode; wherein the neighbor blocks ofthe current block comprise at least one of the following: neighborblocks on a left side of the current block in the image; and neighborblocks above the current block in the image.
 17. The method of claim 16,wherein the determined quantization mode for the current blockcorresponds to a level of quantization quality of the current block. 18.The method of claim 16, wherein the step of determining the quantizationmode for the current block comprises: determining the quantization modefor the current block in an intra-frame manner or an inter-frame manner,according to the parameter information of the neighbor blocks.
 19. Themethod of claim 16, wherein the parameter information comprises at leastone of the following: frame type information; block mode information onthe neighbor blocks; prediction information on the neighbor blocks;motion vector information on the neighbor blocks; and information onquantization modes used by the neighbor blocks.
 20. The method of claim19, wherein the block mode information comprises at least one of thefollowing: a block size determined according to block partitioninformation of the block mode information; a block type determinedaccording to the block mode information; a block direction determinedaccording to block direction information on the block mode information;and a block mode distribution information on the neighbor blocksdetermined according to a spatial distribution relationship of the blockmode information on the neighbor blocks.
 21. An apparatus for realizingadaptive quantization in image encoding, wherein an image to be encodedis divided into one or more blocks, and a current block of the one ormore blocks is transformed to obtain one or more transform coefficients,the apparatus comprising: a neighboring block information extractorunit, configured to acquire parameter information of neighbor blocks ofthe current block; a quantization mode decision unit, configured todetermine a quantization mode for the current block according to theparameter information of the neighbor blocks; and a quantizationprocessing unit, configured to quantize transform coefficients of thecurrent block with the determined quantization mode; wherein thequantization mode includes at least one of a quantization matrix, aquantization parameter, and a quantization step.
 22. The apparatus ofclaim 21, wherein the parameter information acquired in the neighboringblock information extractor unit comprises at least one of thefollowing: frame type information; block mode information on theneighbor blocks; prediction information on the neighbor blocks; motionvector information on the neighbor blocks; and information onquantization modes used by the neighbor blocks.
 23. The apparatus ofclaim 21, wherein the quantization mode decision unit is configured to:determine the quantization mode for the current block in an intra-framemanner or an inter-frame manner, according to the parameter informationof the neighbor blocks.
 24. The apparatus of claim 21, wherein theneighbor blocks of the current block comprise at least one of thefollowing: neighbor blocks on a left side of the current block in theimage; and neighbor blocks above the current block in the image.
 25. Theapparatus of claim 22, wherein the block mode information comprises atleast one of the following: a block size determined according to blockpartition information of the block mode information; a block typedetermined according to the block mode information; a block directiondetermined according to block direction information on the block modeinformation; and a block mode distribution information on the neighborblocks determined according to a spatial distribution relationship ofthe block mode information on the neighbor blocks.
 26. An apparatus forrealizing adaptive quantization in image encoding, wherein an image tobe encoded is divided into one or more blocks, and a current block ofthe one or more blocks is transformed to obtain one or more transformcoefficients, the apparatus comprising: a neighboring block informationextractor unit, configured to acquire parameter information of neighborblocks of the current block; a quantization mode decision unit,configured to determine a quantization mode for the current blockaccording to the parameter information of the neighbor blocks; and aquantization processing unit, configured to quantize transformcoefficients of the current block with the determined quantization mode;wherein the neighbor blocks of the current block comprise at least oneof the following: neighbor blocks on a left side of the current block inthe image; and neighbor blocks above the current block in the image. 27.The apparatus of claim 26, wherein the determined quantization mode bythe quantization mode decision unit corresponds to a level ofquantization quality of the current block.
 28. The apparatus of claim26, wherein the quantization mode decision unit is configured to:determine the quantization mode for the current block in an intra-framemanner or an inter-frame manner, according to the parameter informationof the neighbor blocks.
 29. The apparatus of claim 26, wherein theparameter information acquired in the neighboring block informationextractor unit comprises at least one of the following: frame typeinformation; block mode information on the neighbor blocks; predictioninformation on the neighbor blocks; motion vector information on theneighbor blocks; and information on quantization modes used by theneighbor blocks.
 30. The apparatus of claim 29, wherein the block modeinformation comprises at least one of the following: a block sizedetermined according to block partition information of the block modeinformation; a block type determined according to the block modeinformation; a block direction determined according to block directioninformation on the block mode information; and a block mode distributioninformation on the neighbor blocks determined according to a spatialdistribution relationship of the block mode information on the neighborblocks.
 31. An apparatus for realizing adaptive dequantization in imagedecoding, wherein an image is divided into one or more blocks, andquantized transform coefficients of a current block of the one or moreblocks are obtained from a bitstream, the apparatus comprising: aneighboring block information extractor unit, configured to acquireparameter information of neighbor blocks of the current block; aquantization mode decision unit, configured to determine a quantizationmode for the current block according to the parameter information of theneighbor blocks; and a dequantization processing unit, configured todequantize quantized transform coefficients of the current block withthe determined quantization mode; wherein the quantization mode includesat least one of a quantization matrix, a quantization parameter, and aquantization step.
 32. The apparatus of claim 31, wherein the parameterinformation acquired in the neighboring block information extractor unitcomprises at least one of the following: frame type information; blockmode information on the neighbor blocks; prediction information on theneighbor blocks; motion vector information on the neighbor blocks; andinformation on quantization modes used by the neighbor blocks.
 33. Theapparatus of claim 31, wherein the quantization mode decision unit isconfigured to: determine the quantization mode for the current block inan intra-frame manner or an inter-frame manner, according to theparameter information of the neighbor blocks.
 34. The apparatus of claim31, wherein the neighbor blocks of the current block comprise at leastone of the following: neighbor blocks on a left side of the currentblock in the image; and neighbor blocks above the current block in theimage.
 35. The apparatus of claim 32, wherein the block mode informationcomprises at least one of the following: a block size determinedaccording to block partition information of the block mode information;a block type determined according to the block mode information; a blockdirection determined according to block direction information on theblock mode information; and a block mode distribution information on theneighbor blocks determined according to a spatial distributionrelationship of the block mode information on the neighbor blocks. 36.An apparatus for realizing adaptive dequantization in image decoding,wherein an image is divided into one or more blocks, and quantizedtransform coefficients of a current block of the one or more blocks areobtained from a bitstream, the apparatus comprising: a neighboring blockinformation extractor unit, configured to acquire parameter informationof neighbor blocks of the current block; a quantization mode decisionunit, configured to determine a quantization mode for the current blockaccording to the parameter information of the neighbor blocks; and adequantization processing unit, configured to dequantize transformcoefficients of the current block with the determined quantization mode;wherein the neighbor blocks of the current block comprise at least oneof the following: neighbor blocks on a left side of the current block inthe image; and neighbor blocks above the current block in the image. 37.The apparatus of claim 36, wherein the determined quantization mode bythe quantization mode decision unit corresponds to a level ofquantization quality of the current block.
 38. The apparatus of claim36, wherein the quantization mode decision unit is configured to:determine the quantization mode for the current block in an intra-framemanner or an inter-frame manner, according to the parameter informationof the neighbor blocks.
 39. The apparatus of claim 36, wherein theparameter information acquired in the neighboring block informationextractor unit comprises at least one of the following: frame typeinformation; block mode information on the neighbor blocks; predictioninformation on the neighbor blocks; motion vector information on theneighbor blocks; and information on quantization modes used by theneighbor blocks.
 40. The apparatus of claim 39, wherein the block modeinformation comprises at least one of the following: a block sizedetermined according to block partition information of the block modeinformation; a block type determined according to the block modeinformation; a block direction determined according to block directioninformation on the block mode information; and a block mode distributioninformation on the neighbor blocks determined according to a spatialdistribution relationship of the block mode information on the neighborblocks.